package com.tianyi.sfzy1.service;

import com.tianyi.sfzy1.domain.Consultationappointment;
import com.tianyi.sfzy1.mapper.ConsultationappointmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConsultationappointmentService {
    @Autowired
    private ConsultationappointmentMapper consultationappointmentMapper;
    public int updateFinishStatus(Integer appointmentId, Integer finishStatus){
        return consultationappointmentMapper.updateFinishStatus(appointmentId, finishStatus);
    }

    public int insertConsultationappointment(Consultationappointment consultationappointment){
        return consultationappointmentMapper.insertConsultationappointment(consultationappointment);
    }

    //根据用户id和咨询状态查询记录
    public List<Consultationappointment> findAll(int memberId, int status){
        return consultationappointmentMapper.findAll(memberId,status);
    }

    //根据咨询id删除未完成的咨询记录
    public int delete(int id){
        return consultationappointmentMapper.deleteByPrimaryKey(id);
    }

}
